$(document).ready(function(){
	$("#sendemilBtn").click(function(){
		var toMail = $("#toMail").val();
		var subject = $("#subject").val();
		var content = $("#text").val();
		$.ajax({
			type: 'POST',
			url: '../MailServlet?method=getMailList',
			data: {
				"toMail": toMail,
				"subject": subject,
				"content": content
			},
			success:function(data){
				var info = JSON.parse(data).info;
				alert(info);
				reset();
			},
			error:function(){
				console.log("error");
			}
		})
	})
})

function reset(){
	
	var toMail = document.getElementById("toMail");
	toMail.value="";
	var subject = document.getElementById("subject");
	subject.value="";
	var content = document.getElementById("text");
	content.value="";
}